Optimal. Leaf size=225 \[ \frac {a^2 \left (6 a^2 A-16 a b B-13 A b^2\right ) \cot ^2(c+d x)}{12 d}+\frac {a \left (6 a^3 B+24 a^2 A b-34 a b^2 B-19 A b^3\right ) \cot (c+d x)}{6 d}+\frac {\left (a^4 A-4 a^3 b B-6 a^2 A b^2+4 a b^3 B+A b^4\right ) \log (\sin (c+d x))}{d}+x \left (a^4 B+4 a^3 A b-6 a^2 b^2 B-4 a A b^3+b^4 B\right )-\frac {a (4 a B+7 A b) \cot ^3(c+d x) (a+b \tan (c+d x))^2}{12 d}-\frac {a A \cot ^4(c+d x) (a+b \tan (c+d x))^3}{4 d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.64, antiderivative size = 225, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 6, integrand size = 31, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.194, Rules used = {3605, 3645, 3635, 3628, 3531, 3475} \[ \frac {a^2 \left (6 a^2 A-16 a b B-13 A b^2\right ) \cot ^2(c+d x)}{12 d}+\frac {a \left (24 a^2 A b+6 a^3 B-34 a b^2 B-19 A b^3\right ) \cot (c+d x)}{6 d}+\frac {\left (-6 a^2 A b^2+a^4 A-4 a^3 b B+4 a b^3 B+A b^4\right ) \log (\sin (c+d x))}{d}+x \left (4 a^3 A b-6 a^2 b^2 B+a^4 B-4 a A b^3+b^4 B\right )-\frac {a (4 a B+7 A b) \cot ^3(c+d x) (a+b \tan (c+d x))^2}{12 d}-\frac {a A \cot ^4(c+d x) (a+b \tan (c+d x))^3}{4 d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3475
Rule 3531
Rule 3605
Rule 3628
Rule 3635
Rule 3645
Rubi steps
\begin {align*} \int \cot ^5(c+d x) (a+b \tan (c+d x))^4 (A+B \tan (c+d x)) \, dx &=-\frac {a A \cot ^4(c+d x) (a+b \tan (c+d x))^3}{4 d}+\frac {1}{4} \int \cot ^4(c+d x) (a+b \tan (c+d x))^2 \left (a (7 A b+4 a B)-4 \left (a^2 A-A b^2-2 a b B\right ) \tan (c+d x)-b (a A-4 b B) \tan ^2(c+d x)\right ) \, dx\\ &=-\frac {a (7 A b+4 a B) \cot ^3(c+d x) (a+b \tan (c+d x))^2}{12 d}-\frac {a A \cot ^4(c+d x) (a+b \tan (c+d x))^3}{4 d}+\frac {1}{12} \int \cot ^3(c+d x) (a+b \tan (c+d x)) \left (-2 a \left (6 a^2 A-13 A b^2-16 a b B\right )-12 \left (3 a^2 A b-A b^3+a^3 B-3 a b^2 B\right ) \tan (c+d x)-2 b \left (5 a A b+2 a^2 B-6 b^2 B\right ) \tan ^2(c+d x)\right ) \, dx\\ &=\frac {a^2 \left (6 a^2 A-13 A b^2-16 a b B\right ) \cot ^2(c+d x)}{12 d}-\frac {a (7 A b+4 a B) \cot ^3(c+d x) (a+b \tan (c+d x))^2}{12 d}-\frac {a A \cot ^4(c+d x) (a+b \tan (c+d x))^3}{4 d}+\frac {1}{12} \int \cot ^2(c+d x) \left (-2 a \left (24 a^2 A b-19 A b^3+6 a^3 B-34 a b^2 B\right )+12 \left (a^4 A-6 a^2 A b^2+A b^4-4 a^3 b B+4 a b^3 B\right ) \tan (c+d x)-2 b^2 \left (5 a A b+2 a^2 B-6 b^2 B\right ) \tan ^2(c+d x)\right ) \, dx\\ &=\frac {a \left (24 a^2 A b-19 A b^3+6 a^3 B-34 a b^2 B\right ) \cot (c+d x)}{6 d}+\frac {a^2 \left (6 a^2 A-13 A b^2-16 a b B\right ) \cot ^2(c+d x)}{12 d}-\frac {a (7 A b+4 a B) \cot ^3(c+d x) (a+b \tan (c+d x))^2}{12 d}-\frac {a A \cot ^4(c+d x) (a+b \tan (c+d x))^3}{4 d}+\frac {1}{12} \int \cot (c+d x) \left (12 \left (a^4 A-6 a^2 A b^2+A b^4-4 a^3 b B+4 a b^3 B\right )+12 \left (4 a^3 A b-4 a A b^3+a^4 B-6 a^2 b^2 B+b^4 B\right ) \tan (c+d x)\right ) \, dx\\ &=\left (4 a^3 A b-4 a A b^3+a^4 B-6 a^2 b^2 B+b^4 B\right ) x+\frac {a \left (24 a^2 A b-19 A b^3+6 a^3 B-34 a b^2 B\right ) \cot (c+d x)}{6 d}+\frac {a^2 \left (6 a^2 A-13 A b^2-16 a b B\right ) \cot ^2(c+d x)}{12 d}-\frac {a (7 A b+4 a B) \cot ^3(c+d x) (a+b \tan (c+d x))^2}{12 d}-\frac {a A \cot ^4(c+d x) (a+b \tan (c+d x))^3}{4 d}+\left (a^4 A-6 a^2 A b^2+A b^4-4 a^3 b B+4 a b^3 B\right ) \int \cot (c+d x) \, dx\\ &=\left (4 a^3 A b-4 a A b^3+a^4 B-6 a^2 b^2 B+b^4 B\right ) x+\frac {a \left (24 a^2 A b-19 A b^3+6 a^3 B-34 a b^2 B\right ) \cot (c+d x)}{6 d}+\frac {a^2 \left (6 a^2 A-13 A b^2-16 a b B\right ) \cot ^2(c+d x)}{12 d}+\frac {\left (a^4 A-6 a^2 A b^2+A b^4-4 a^3 b B+4 a b^3 B\right ) \log (\sin (c+d x))}{d}-\frac {a (7 A b+4 a B) \cot ^3(c+d x) (a+b \tan (c+d x))^2}{12 d}-\frac {a A \cot ^4(c+d x) (a+b \tan (c+d x))^3}{4 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] time = 0.94, size = 211, normalized size = 0.94 \[ \frac {-3 a^4 A \cot ^4(c+d x)-4 a^3 (a B+4 A b) \cot ^3(c+d x)+6 a^2 \left (a^2 A-4 a b B-6 A b^2\right ) \cot ^2(c+d x)+12 a \left (a^3 B+4 a^2 A b-6 a b^2 B-4 A b^3\right ) \cot (c+d x)+12 \left (a^4 A-4 a^3 b B-6 a^2 A b^2+4 a b^3 B+A b^4\right ) \log (\tan (c+d x))-6 (a-i b)^4 (A-i B) \log (\tan (c+d x)+i)-6 (a+i b)^4 (A+i B) \log (-\tan (c+d x)+i)}{12 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.55, size = 249, normalized size = 1.11 \[ \frac {6 \, {\left (A a^{4} - 4 \, B a^{3} b - 6 \, A a^{2} b^{2} + 4 \, B a b^{3} + A b^{4}\right )} \log \left (\frac {\tan \left (d x + c\right )^{2}}{\tan \left (d x + c\right )^{2} + 1}\right ) \tan \left (d x + c\right )^{4} - 3 \, A a^{4} + 3 \, {\left (3 \, A a^{4} - 8 \, B a^{3} b - 12 \, A a^{2} b^{2} + 4 \, {\left (B a^{4} + 4 \, A a^{3} b - 6 \, B a^{2} b^{2} - 4 \, A a b^{3} + B b^{4}\right )} d x\right )} \tan \left (d x + c\right )^{4} + 12 \, {\left (B a^{4} + 4 \, A a^{3} b - 6 \, B a^{2} b^{2} - 4 \, A a b^{3}\right )} \tan \left (d x + c\right )^{3} + 6 \, {\left (A a^{4} - 4 \, B a^{3} b - 6 \, A a^{2} b^{2}\right )} \tan \left (d x + c\right )^{2} - 4 \, {\left (B a^{4} + 4 \, A a^{3} b\right )} \tan \left (d x + c\right )}{12 \, d \tan \left (d x + c\right )^{4}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [B] time = 7.88, size = 584, normalized size = 2.60 \[ -\frac {3 \, A a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} - 8 \, B a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 32 \, A a^{3} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 36 \, A a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 96 \, B a^{3} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 144 \, A a^{2} b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 120 \, B a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 480 \, A a^{3} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 576 \, B a^{2} b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 384 \, A a b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 192 \, {\left (B a^{4} + 4 \, A a^{3} b - 6 \, B a^{2} b^{2} - 4 \, A a b^{3} + B b^{4}\right )} {\left (d x + c\right )} + 192 \, {\left (A a^{4} - 4 \, B a^{3} b - 6 \, A a^{2} b^{2} + 4 \, B a b^{3} + A b^{4}\right )} \log \left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1\right ) - 192 \, {\left (A a^{4} - 4 \, B a^{3} b - 6 \, A a^{2} b^{2} + 4 \, B a b^{3} + A b^{4}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) \right |}\right ) + \frac {400 \, A a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} - 1600 \, B a^{3} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} - 2400 \, A a^{2} b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} + 1600 \, B a b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} + 400 \, A b^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} - 120 \, B a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 480 \, A a^{3} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 576 \, B a^{2} b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 384 \, A a b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 36 \, A a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 96 \, B a^{3} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 144 \, A a^{2} b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 8 \, B a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 32 \, A a^{3} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 3 \, A a^{4}}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4}}}{192 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.46, size = 347, normalized size = 1.54 \[ -\frac {2 B \,a^{3} b \left (\cot ^{2}\left (d x +c \right )\right )}{d}-\frac {4 A \,a^{3} b \left (\cot ^{3}\left (d x +c \right )\right )}{3 d}-\frac {3 A \,a^{2} b^{2} \left (\cot ^{2}\left (d x +c \right )\right )}{d}+a^{4} B x +\frac {B \cot \left (d x +c \right ) a^{4}}{d}+\frac {A \,a^{4} \left (\cot ^{2}\left (d x +c \right )\right )}{2 d}+B \,b^{4} x +\frac {A \,b^{4} \ln \left (\sin \left (d x +c \right )\right )}{d}+\frac {a^{4} B c}{d}+\frac {B \,b^{4} c}{d}+4 A \,a^{3} b x -6 B \,a^{2} b^{2} x -4 A a \,b^{3} x +\frac {4 A \,a^{3} b c}{d}-\frac {6 B \,a^{2} b^{2} c}{d}-\frac {4 A a \,b^{3} c}{d}-\frac {A \,a^{4} \left (\cot ^{4}\left (d x +c \right )\right )}{4 d}-\frac {a^{4} B \left (\cot ^{3}\left (d x +c \right )\right )}{3 d}-\frac {4 B \,a^{3} b \ln \left (\sin \left (d x +c \right )\right )}{d}-\frac {6 A \,a^{2} b^{2} \ln \left (\sin \left (d x +c \right )\right )}{d}+\frac {4 B a \,b^{3} \ln \left (\sin \left (d x +c \right )\right )}{d}-\frac {6 B \cot \left (d x +c \right ) a^{2} b^{2}}{d}-\frac {4 A \cot \left (d x +c \right ) a \,b^{3}}{d}+\frac {4 A \cot \left (d x +c \right ) a^{3} b}{d}+\frac {a^{4} A \ln \left (\sin \left (d x +c \right )\right )}{d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.66, size = 246, normalized size = 1.09 \[ \frac {12 \, {\left (B a^{4} + 4 \, A a^{3} b - 6 \, B a^{2} b^{2} - 4 \, A a b^{3} + B b^{4}\right )} {\left (d x + c\right )} - 6 \, {\left (A a^{4} - 4 \, B a^{3} b - 6 \, A a^{2} b^{2} + 4 \, B a b^{3} + A b^{4}\right )} \log \left (\tan \left (d x + c\right )^{2} + 1\right ) + 12 \, {\left (A a^{4} - 4 \, B a^{3} b - 6 \, A a^{2} b^{2} + 4 \, B a b^{3} + A b^{4}\right )} \log \left (\tan \left (d x + c\right )\right ) - \frac {3 \, A a^{4} - 12 \, {\left (B a^{4} + 4 \, A a^{3} b - 6 \, B a^{2} b^{2} - 4 \, A a b^{3}\right )} \tan \left (d x + c\right )^{3} - 6 \, {\left (A a^{4} - 4 \, B a^{3} b - 6 \, A a^{2} b^{2}\right )} \tan \left (d x + c\right )^{2} + 4 \, {\left (B a^{4} + 4 \, A a^{3} b\right )} \tan \left (d x + c\right )}{\tan \left (d x + c\right )^{4}}}{12 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 6.47, size = 218, normalized size = 0.97 \[ \frac {\ln \left (\mathrm {tan}\left (c+d\,x\right )\right )\,\left (A\,a^4-4\,B\,a^3\,b-6\,A\,a^2\,b^2+4\,B\,a\,b^3+A\,b^4\right )}{d}-\frac {{\mathrm {cot}\left (c+d\,x\right )}^4\,\left (\mathrm {tan}\left (c+d\,x\right )\,\left (\frac {B\,a^4}{3}+\frac {4\,A\,b\,a^3}{3}\right )+\frac {A\,a^4}{4}-{\mathrm {tan}\left (c+d\,x\right )}^3\,\left (B\,a^4+4\,A\,a^3\,b-6\,B\,a^2\,b^2-4\,A\,a\,b^3\right )+{\mathrm {tan}\left (c+d\,x\right )}^2\,\left (-\frac {A\,a^4}{2}+2\,B\,a^3\,b+3\,A\,a^2\,b^2\right )\right )}{d}-\frac {\ln \left (\mathrm {tan}\left (c+d\,x\right )+1{}\mathrm {i}\right )\,\left (A-B\,1{}\mathrm {i}\right )\,{\left (b+a\,1{}\mathrm {i}\right )}^4}{2\,d}-\frac {\ln \left (\mathrm {tan}\left (c+d\,x\right )-\mathrm {i}\right )\,\left (A+B\,1{}\mathrm {i}\right )\,{\left (-b+a\,1{}\mathrm {i}\right )}^4}{2\,d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [A] time = 8.87, size = 459, normalized size = 2.04 \[ \begin {cases} \tilde {\infty } A a^{4} x & \text {for}\: \left (c = 0 \vee c = - d x\right ) \wedge \left (c = - d x \vee d = 0\right ) \\x \left (A + B \tan {\relax (c )}\right ) \left (a + b \tan {\relax (c )}\right )^{4} \cot ^{5}{\relax (c )} & \text {for}\: d = 0 \\- \frac {A a^{4} \log {\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{2 d} + \frac {A a^{4} \log {\left (\tan {\left (c + d x \right )} \right )}}{d} + \frac {A a^{4}}{2 d \tan ^{2}{\left (c + d x \right )}} - \frac {A a^{4}}{4 d \tan ^{4}{\left (c + d x \right )}} + 4 A a^{3} b x + \frac {4 A a^{3} b}{d \tan {\left (c + d x \right )}} - \frac {4 A a^{3} b}{3 d \tan ^{3}{\left (c + d x \right )}} + \frac {3 A a^{2} b^{2} \log {\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{d} - \frac {6 A a^{2} b^{2} \log {\left (\tan {\left (c + d x \right )} \right )}}{d} - \frac {3 A a^{2} b^{2}}{d \tan ^{2}{\left (c + d x \right )}} - 4 A a b^{3} x - \frac {4 A a b^{3}}{d \tan {\left (c + d x \right )}} - \frac {A b^{4} \log {\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{2 d} + \frac {A b^{4} \log {\left (\tan {\left (c + d x \right )} \right )}}{d} + B a^{4} x + \frac {B a^{4}}{d \tan {\left (c + d x \right )}} - \frac {B a^{4}}{3 d \tan ^{3}{\left (c + d x \right )}} + \frac {2 B a^{3} b \log {\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{d} - \frac {4 B a^{3} b \log {\left (\tan {\left (c + d x \right )} \right )}}{d} - \frac {2 B a^{3} b}{d \tan ^{2}{\left (c + d x \right )}} - 6 B a^{2} b^{2} x - \frac {6 B a^{2} b^{2}}{d \tan {\left (c + d x \right )}} - \frac {2 B a b^{3} \log {\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{d} + \frac {4 B a b^{3} \log {\left (\tan {\left (c + d x \right )} \right )}}{d} + B b^{4} x & \text {otherwise} \end {cases} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________